import { ColumnProps } from '~/library/components/ProTable/interface'
import { StoreManagement } from '~/src/api/interface/storeManagement'
import { genderType } from '~/src/utils/serviceDict'

export const departColumn: ColumnProps<StoreManagement.DepartmentList>[] = [
  { type: 'selection', width: 60 },
  { type: 'index', label: '序号', width: 60 },
  { prop: 'number', sortable: true, label: '部门编码', align: 'left', minWidth: 120, search: { el: 'input' } },
  { prop: 'name', sortable: true, label: '部门名称', minWidth: 120, align: 'left', search: { el: 'input' } },
  // {
  //   prop: "roleIds",
  //   label: "部门职能",
  //   enum: [
  //     { label: "出品部门", value: 1 },
  //     { label: "行政部门", value: 2 },
  //     { label: "销售部门", value: 3 }
  //   ],
  //   isFilterEnum: false,
  //   align: "left",
  //   search: { el: "select", multiple: true, props: { filterable: true } }
  // },
  {
    prop: 'status',
    label: '状态',
    minWidth: 120,
    sortable: true,
    align: 'left',
    enum: [
      { label: '启用', value: 1 },
      { label: '禁用', value: 2 },
    ],
  },
  { prop: 'createTime', sortable: true, label: '创建时间', minWidth: 164, align: 'left' },
  { prop: 'updateName', sortable: true, label: '最后修改人', minWidth: 120, align: 'left' },
  { prop: 'updateTime', sortable: true, label: '最后更新时间', minWidth: 164, align: 'left' },
  // { prop: 'operation', label: '操作', fixed: 'right', width: 220 },
]

// 表格配置项
export const staffColumn: ColumnProps<StoreManagement.StaffInfo>[] = [
  { type: 'index', label: '序号', width: 60 },
  { type: 'selection', width: 60 },
  { prop: 'name', label: '员工姓名', sortable: true, minWidth: 120, align: 'left', search: { el: 'input' } },
  { prop: 'mobile', label: '手机号码', sortable: true, minWidth: 120, align: 'left', search: { el: 'input' } },
  {
    prop: 'sex',
    label: '性别',
    sortable: true,
    minWidth: 100,
    enum: genderType,
    search: { el: 'select' },
  },
  { prop: 'birthday', sortable: true, label: '生日', minWidth: 164, align: 'left' },
  { prop: 'nickName', sortable: true, label: '昵称', minWidth: 180, align: 'left' },
  // { prop: 'operation', label: '操作', fixed: 'right', width: 220 },
]

export const storeColumn: ColumnProps<StoreManagement.Store>[] = [
  { type: 'index', label: '序号', width: 60 },
  { prop: 'storeName', sortable: true, label: '门店名称', minWidth: 240, align: 'left', search: { el: 'input' } },
  { prop: 'id', sortable: true, label: '门店ID', minWidth: 120, align: 'left' },
  { prop: 'address', sortable: true, label: '门店地址', minWidth: 120, align: 'left' },
  { prop: 'linkMan', sortable: true, label: '门店联系人', minWidth: 120, align: 'left' },
  { prop: 'mobile', sortable: true, label: '联系电话', minWidth: 160, align: 'left' },
  {
    prop: 'status',
    label: '状态',
    sortable: true,
    align: 'left',
    minWidth: 120,
    enum: [
      { label: '启用', value: 1 },
      { label: '禁用', value: 2 },
    ],
  },
  { prop: 'operation', label: '操作', fixed: 'right', width: 180 },
]
export const TimeintervalDialogColumn: ColumnProps<StoreManagement.StoreMarketDetail>[] = [
  { prop: 'index', label: '序号', width: 80 },
  { prop: 'name', label: '餐段名称', align: 'left' },
  { prop: 'starTime', label: '开始时间', align: 'left' },
  { prop: 'endTime', label: '结束时间', align: 'left' },
  { prop: 'status', label: '是否启用', fixed: 'right' },
]
